load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_binary.bzl", "rust_binary")

oncall("sapling")

rust_binary(
    name = "backingstore-benches",
    srcs = glob([
        "src/**/*.rs",
    ]),
    autocargo = {"cargo_toml_config": {
        "extra_buck_dependencies": {"dependencies": [
            "//common/rust/shed/fbinit:fbinit",
            "//eden/scm/lib/config/loader:configloader",
        ]},
        "features": {"fb": ["sapling-configloader/fb"]},
    }},
    crate_root = "src/main.rs",
    metadata = {
        "buck.cfg_modifiers": [
            "fbcode//eden/scm/lib/backingstore:edenfs-include-cas",
        ],
    },
    deps = [
        "fbsource//third-party/rust:tempfile",
        "//eden/scm/lib/backingstore:backingstore",
        "//eden/scm/lib/identity:identity",
        "//eden/scm/lib/minibench:minibench",
        "//eden/scm/lib/procinfo:procinfo",
        "//eden/scm/lib/repo:repo",
        "//eden/scm/lib/types:types",
    ] + ([] if rust_oss.is_oss_build() else [
        "//common/rust/shed/fbinit:fbinit",
    ]),
)
